!function (w,e) {
	function Game (option=null) {
		Object.assign(this,{
			nX: 4,
			nY: 4,
			pWidth: 100,
			grid: null,
			container: null
		},option)
		this.init()
	}
	Game.prototype = {
		init(){
			if(this.initContainer()){
				this.initGrid()
			}
		},
		initContainer(){
			if(!this.el) return false
			try{
				this.container = e.querySelector(this.el)
			}catch(err){
				console.warn(err)
			}
			if(!this.container) return false
			return true
		},
		initGrid(){
			this.grid = []
			for(let i = 0; i < this.nY; i++){
				this.grid[i] = []
				for(let j = 0; j < this.nX; j++){
					this.grid[i][j] = {
						originPos: [j,i],
						currPos: [j,i]
					}
				}
			}
		}
	}
	new Game({
		el: '.container'
	})
}(window,document)